package com.schoolComments.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 马园博
 * @date 2023/05/06/10:20
 * @Project hm-dianping
 * 配置Redisson
 **/
@Configuration
public class RedissonConfig {
    @Bean
    public RedissonClient redissonClient(){
        //配置Config
        Config config = new Config();
        config.useSingleServer().setAddress("redis://localhost:6379");
        //创建RedissonClient对象
        return Redisson.create(config);
    }
}
